VNC Viewer VCL Control is a independent control that realizes all the vnc viewer's function. It consists of pure Object Pascal sources without any other libraries. The Details include:
Open the
"DVNC.dpk" project, and click the "install" button to install.
After installation, you can find VNC Viewer Control in the "U-solution"
palette.
There are several properties of the
control:
Published:
Public:
property AutoScroll: Boolean;
Description
If AutoScroll is true, the scroll bars appear automatically when necessary. For example, if the user resizes the control so that some of its controls are partially obscured, scroll bars appear.
If AutoScroll is false, scroll bars don't appear automatically. In this case, use the HorzScrollBar and VertScrollBar properties to make scroll bars appear.
If the property Stretch is set, it will take no effect.
Property Codec: TVNCCodec;
TVNCCodec=(vncHextile, vncCoRRE, vncRRE, vncCopyRect, vncRAW)
Property EnableBell: boolean;
Description
if EnableBell is true, the viewer will bell when the server bell.
Property FrameUpdateDelay: Word;
Description
FrameUpdateDelay determines how frequently the viewer will request frames updating from the server in milliseconds
Property Password: String;
description
The login password of the viewer.
Property Port: Integer;
Description
The login Port of the viewer.
Property Server:String;
Description
The Address the viewer will connect to.
Property RequestFrames: Boolean;
Description
If the RequestFrames is true, the viewer will reuqest updating from the server every "RequestFramesDelay" milliseconds. Or the viewer will never update.
Property PixelFormat: TPixelFormat;
TPixelFormat=(VNCAuto,VNC8Bit)
Property ShareDesktop: Boolean;
Description
If ShareDesktop is ture, the server will not disconnect other clients when the viewer logined.
Property Stretch: Boolean;
Description
If Stretch is true, the remote screen will stretch to the width and height the user set. And the property AutoScroll will take no effect.
Property TransferKeys: boolean;
Description
if TransferKeys is true, The viewer will transfer the key actions to the server.
Property TransferMouse: boolean;
Description
if TransferMouse is true, The viewer will transfer the mouseactions to the server.
Property TransferLocalClipboard: boolean;
Description
if TransferLocalClipboard is true, The viewer will transfer the local clipboard actions to the server.
Property TransferServerClipboard: boolean;
Description
if TransferServerClipboard is true, server will transfer the server clipboard actions to the viewer.
Property xPosition: Integer;
Description
xPosition is x position of the left-top point of the remote screen Which will display in the viewer control's rectangle.
Property yPosition: Integer;
Description
yPosition is yposition of the left-top point of the remote screen Which will display in the viewer control's rectangle
The VNC Viewer Control have three method:
Procedure Connect;
Description
Connect to the server using the property "Server", "Port", "Password" are set.
Procedure Disconnect;
Description
Disconnect the viewer from server.
Procedure RequestUpdate;
Descriptio
Force the viewer to update a frame.
The VNC Viewer control have seven special events:
procedure OnAuthFail(Sender: TObject)
Description
When the viewer login to server fail, the event will occur.
procedure OnConnectClose(Sender: TObject)
Description
When the viewer disconnect from server, the event will occur.
Procedure OnConnected(Sender: TObject)
Description
When the Viewer connected to the server, the event occurs
Procedure OnConnectError(Sender: TObject; ErrorMsg: String);
Description
When error happened during the viewer is connecting to the server, the event occurs. The ErrorMsg is the error message.
Procedure OnFrameSize(Sender: TObject; FrameWidth,FrameHeight: Integer);
Description
When viewer login to server successfully, the server will return the width and height of the remote screen, then the event occurs. FrameWidth and FrameHeight are the width and height of remote screen.
Procedure OnHostname(Sender: Tobject; HostName:String);
Description
When viewer login to server successfully, the server will return the name of the remote host. HostName is the name of the remote host.
Procedure OnStatus(Sender: TObject; ErrorMsg: String);
Description
The event occurs during the login process. The ErrorMsg is the message return.